package b.a.o;

import android.view.View;
import android.view.animation.Interpolator;
import b.f.l.w;
import b.f.l.x;
import b.f.l.y;
import java.util.ArrayList;
import java.util.Iterator;

public class h {

    /* renamed from: a  reason: collision with root package name */
    final ArrayList<w> f1130a = new ArrayList<>();

    /* renamed from: b  reason: collision with root package name */
    private long f1131b = -1;

    /* renamed from: c  reason: collision with root package name */
    private Interpolator f1132c;

    /* renamed from: d  reason: collision with root package name */
    x f1133d;
    private boolean e;
    private final y f = new a();

    class a extends y {

        /* renamed from: a  reason: collision with root package name */
        private boolean f1134a = false;

        /* renamed from: b  reason: collision with root package name */
        private int f1135b = 0;

        a() {
        }

        public void a(View view) {
            int i = this.f1135b + 1;
            this.f1135b = i;
            if (i == h.this.f1130a.size()) {
                x xVar = h.this.f1133d;
                if (xVar != null) {
                    xVar.a((View) null);
                }
                d();
            }
        }

        public void b(View view) {
            if (!this.f1134a) {
                this.f1134a = true;
                x xVar = h.this.f1133d;
                if (xVar != null) {
                    xVar.b((View) null);
                }
            }
        }

        /* access modifiers changed from: package-private */
        public void d() {
            this.f1135b = 0;
            this.f1134a = false;
            h.this.b();
        }
    }

    public void a() {
        if (this.e) {
            Iterator<w> it = this.f1130a.iterator();
            while (it.hasNext()) {
                it.next().b();
            }
            this.e = false;
        }
    }

    /* access modifiers changed from: package-private */
    public void b() {
        this.e = false;
    }

    public h c(w wVar) {
        if (!this.e) {
            this.f1130a.add(wVar);
        }
        return this;
    }

    public h d(w wVar, w wVar2) {
        this.f1130a.add(wVar);
        wVar2.h(wVar.c());
        this.f1130a.add(wVar2);
        return this;
    }

    public h e(long j) {
        if (!this.e) {
            this.f1131b = j;
        }
        return this;
    }

    public h f(Interpolator interpolator) {
        if (!this.e) {
            this.f1132c = interpolator;
        }
        return this;
    }

    public h g(x xVar) {
        if (!this.e) {
            this.f1133d = xVar;
        }
        return this;
    }

    public void h() {
        if (!this.e) {
            Iterator<w> it = this.f1130a.iterator();
            while (it.hasNext()) {
                w next = it.next();
                long j = this.f1131b;
                if (j >= 0) {
                    next.d(j);
                }
                Interpolator interpolator = this.f1132c;
                if (interpolator != null) {
                    next.e(interpolator);
                }
                if (this.f1133d != null) {
                    next.f(this.f);
                }
                next.j();
            }
            this.e = true;
        }
    }
}
